package com.ruoyi.project.bill.service.impl;

import java.util.List;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.project.bill.domain.BillForm;
import com.ruoyi.project.bill.mapper.BillFormMapper;
import com.ruoyi.project.bill.service.IBillFormService;

import lombok.extern.slf4j.Slf4j;
import io.jsonwebtoken.lang.Collections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 单据表单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-03
 */
@Service
@Slf4j
public class BillFormServiceImpl extends ServiceImpl<BillFormMapper, BillForm> implements IBillFormService
{
    @Autowired
    private BillFormMapper billFormMapper;



    /**
     * 查询单据表单
     * 
     * @param id 单据表单主键
     * @return 单据表单
     */
    @Override
    public BillForm selectBillFormById(String id)
    {
        return billFormMapper.selectBillFormById(id);
    }

    /**
     * 批量查询ids
     */
    @Override
    public List<BillForm> selectBillFormByIds(String[] ids)
    {
        return billFormMapper.selectBillFormByIds(ids);
    }

    /**
     * 查询单据表单列表
     * 
     * @param billForm 单据表单
     * @return 单据表单
     */
    @Override
    public List<BillForm> selectBillFormList(BillForm billForm)
    {
        return billFormMapper.selectBillFormList(billForm);
    }

    /**
     * 新增单据表单
     * 
     * @param billForm 单据表单
     * @return 结果
     */
    @Override
    public String insertBillForm(BillForm billForm)
    {
        int code1= billFormMapper.insert(billForm);
    return code1>0? null:"保存失败";
    }

    /**
     * 修改单据表单
     * 
     * @param billForm 单据表单
     * @return 结果
     */
    @Override
    public String updateBillForm(BillForm billForm)
    {
        int code1= billFormMapper.updateById(billForm);
        return code1>0? null:"保存失败";
    }

    /**
     * 批量删除单据表单
     * 
     * @param ids 需要删除的单据表单主键
     * @return 结果
     */
    @Override
    public String deleteBillFormByIds(String[] ids)
    {
        int code = billFormMapper.deleteBatchIds(Collections.arrayToList(ids));
        return code>0?null:"删除失败";
    }

    /**
     * 删除单据表单信息
     * 
     * @param id 单据表单主键
     * @return 结果
     */
    @Override
    public String deleteBillFormById(String id)
    {
        int code= billFormMapper.deleteById(id);
        return code>0?null:"删除失败";
    }

}
